﻿/**
 *
 * @file MaterialDialogFE.h
 * @brief  FE材料对话框声明
 * @author wangning (2185896382@qq.com)
 * @date 2025-02-24
 *
 */
#ifndef __GUIMaterialDialogFE_H__
#define __GUIMaterialDialogFE_H__

#include "AbstractPhysicsDialog.h"

namespace Ui
{
    class MaterialDialogFE;
}

namespace Interface
{
    class FITKMaterialManager;
    class FITKAbaMaterial;
}

namespace GUI
{
    /**
     * @brief FE材料对话框声明
     * @author wangning (2185896382@qq.com)
     * @date 2025-02-24
     */
    class GUIPhyscisDialogAPI MaterialDialogFE : public AbstractMaterialDialog
    {
        Q_OBJECT

    public:
        /**
         * @brief Construct a new Material FE Dialog object
         * @param[i]  type           操作类型
         * @param[i]  matid          材料ID
         * @param[i]  parent         父对象
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-09
         */
        explicit MaterialDialogFE(PhysicsDlgExecType type, int matid = -1, QWidget* parent = nullptr);
        /**
         * @brief Destroy the Material FE Dialog object
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-09
         */
        virtual ~MaterialDialogFE();

    private slots:
        /**
         * @brief 确认按钮点击事件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void on_pushButton_Ok_clicked();
        /**
         * @brief 取消按钮点击事件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void on_pushButton_Cancel_clicked();

    private:
        /**
         * @brief 初始化窗口
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        void init();
        /**
        * @brief 初始化窗口数据
        * @author wangning (2185896382@qq.com)
        * @date 2025-02-24
        */
        void initData();
        /**
         * @brief 检查输入
         * @return true  输入没有错误
         * @return false  输入有错误
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        bool checkInput();
        /**
         * @brief 获取FE材料管理器
         * @author wangning (2185896382@qq.com)
         * @date 2025-02-24
         */
        Interface::FITKMaterialManager* getFEMaterialManager();
        /**
        * @brief   获取单元格文本
        * @param[i]   row 行索引
        * @param[i]   col 列索引
        * @return  文本
        * @author wangning (2185896382@qq.com)
        * @date 2025-02-24
        */
        QString getCellText(int row, int col);

    private:
        /**
         * @brief UI对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-06
         */
        Ui::MaterialDialogFE *_ui{};
        /**
         * @brief FE材料对象
         * @author wangning (2185896382@qq.com)
         * @date 2025-02-24
         */
        Interface::FITKAbaMaterial* _feMat{};
    };
}
#endif
